package com.beyond.common.manager

import com.beyond.common.bean.ThemeState
import com.beyond.common.constant.SPConstantKeys
import com.beyond.common.util.SpUtil

/**
 * @author chen
 * @time 2023/5/31 10:36
 * @name ThemeManager.kt
 * @class describe
 */
object ThemeManager {
    @JvmStatic
    var theme: ThemeState? = null
        get() {
            return field ?: SpUtil.getData(
                SPConstantKeys.SP_APP_THEME,
                ThemeState::class.java
            )
        }
        set(value) {
            field = value
            SpUtil.putData(SPConstantKeys.SP_APP_THEME, value)
        }
}